Overview
The USGS Astrogeology Science Center provides Web Map Service (WMS) endpoints for planetary data. This guide demonstrates how to access these services using GDAL configuration files and web mapping libraries.GDAL WMS Configuration
Overview
GDAL can retrieve images from WMS layers using XML configuration files, enabling command-line access to planetary base maps and elevation data.Basic Usage
WMS Configuration Files
Mars MDIM 2.1 Mosaic
Access the Mars Digital Image Mosaic (MDIM 2.1):- ServerUrl: WMS endpoint URL
- Layers: Layer name (MDIM21)
- ImageFormat:
image/jpegfor RGB imagery - BandsCount: 3 (RGB)
- DataType: Byte (8-bit)
Mars MOLA Elevation
Access Mars Orbiter Laser Altimeter (MOLA) elevation data:- ImageFormat:
image/tifffor elevation data - BandsCount: 1 (elevation only)
- DataType: Int16 (16-bit signed integer)
Moon LOLA Elevation
Access Lunar Orbiter Laser Altimeter (LOLA) elevation data:GDAL WMS Usage Examples
Export Specific Region
Create a configuration file with your desired extent:Get Dataset Information
- Coordinate system
- Pixel size
- Bounding box
- Data type
- Band information
Reproject WMS Data
Create Hillshade from Elevation WMS
OpenLayers Example
Interactive Moon Map
HTML template for displaying lunar WMS layers with OpenLayers:Available Lunar Layers
LOLA_color
Color-coded elevation visualization
LOLA_steel
Grayscale elevation (steel colormap)
LOLA_bw
Black and white shaded relief
LROC_WAC
Wide Angle Camera mosaic
UVVIS
Clementine UVVIS mosaic
KaguyaTC_Ortho
JAXA Kaguya Terrain Camera
LO
Lunar Orbiter mosaic
Leaflet Example
Modern Lunar Web Map
Lightweight alternative using Leaflet:Adding GeoJSON Overlay
Include region of interest as GeoJSON:Custom Styling for GeoJSON
Available WMS Endpoints
USGS Astrogeology WMS Services
- Moon
- Mars
Base URL:
http://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/earth/moon_simp_cyl.mapAvailable Layers:LOLA_color- LOLA elevation (color)LOLA_steel- LOLA elevation (steel)LOLA_bw- LOLA elevation (grayscale)LROC_WAC- LROC Wide Angle Camerauv_v2- Clementine UVVIS v2KaguyaTC_Ortho- Kaguya Terrain CameraLO- Lunar Orbiter
http://wms.wr.usgs.gov/cgi-bin/mapserv?map=/maps/earth/moon_simp_cyl_elev.mapLOLA_elev- LOLA elevation (Int16)
For a complete list of available layers, visit the USGS Astro Web Map Atlas
GetCapabilities Requests
Query Available Layers
Get WMS capabilities to discover all available layers:- Available layers
- Supported formats
- Coordinate systems
- Bounding boxes
- Layer metadata
Parse Capabilities with Python
Advanced Techniques
Transparent Overlays
Combine base imagery with transparent overlays:Time Series Animation
For temporal datasets with time parameter support:GetFeatureInfo Requests
Query pixel values from WMS layers:Performance Optimization
Tile Caching
MapProxy Configuration Example:Request Optimization
Troubleshooting
Common Issues
Issue: “Service not found” errorSolution: Verify the map file path in ServerUrl is correct Issue: Blank tiles or no data
Solution: Check DataWindow coordinates are within valid range (Lon: -180 to 360, Lat: -90 to 90) Issue: Slow performance
Solution: Reduce SizeX/SizeY values, use appropriate image format (JPEG for imagery, TIFF for elevation) Issue: Coordinate system mismatch
Solution: Ensure EPSG:4326 is specified in both Service/SRS and Projection elements
Source Files Reference
gdal_MDIM21.xml- Mars MDIM 2.1 configurationgdal_mars_MOLA_elev.xml- Mars MOLA elevation configurationgdal_moon_LOLA_elev.xml- Moon LOLA elevation configurationOpenLayers_MyMoon.html- OpenLayers implementation exampleleaflet_moonWMS2_wGeoJSON_Box.html- Leaflet implementation example
Additional Resources
USGS Astro Web Maps
Complete layer catalog and documentation
GDAL WMS Driver
GDAL WMS driver documentation
OpenLayers API
OpenLayers documentation and examples
Leaflet Documentation
Leaflet API reference and tutorials